<?php
/**
 * @author Sonnk
 * @copyright 2011
 */
 
class incMenuraovat extends CI_Include
{
	function __construct()
	{
	    parent::__construct();
		//$this->load->incModel();
	
        $data->menus = $this->model->table('sa_danhmucraovat')->select('id,tieude,khongdau,icon')
							  ->where('cap',0)
							  ->where('thungrac',0)
							  ->order_by('vitri','DESC')
							  ->find_all();
		$menus = $this->model->table('sa_danhmucraovat')->select('cap,id,tieude,khongdau')
							  ->where('cap <>',0)
							  ->where('thungrac',0)
							  ->group_by('cap,id')
							  ->order_by('vitri','DESC')
							  ->find_all(); 
		
		$arr_id = array();
		$arr_kd = array();
		$arr_ten = array();
		foreach($menus as $item)
		{
			$arr_id[$item->cap][$item->id] = $item->id;
			$arr_kd[$item->cap][$item->id] = $item->khongdau;
			$arr_ten[$item->cap][$item->id] = $item->tieude;
		}
		$data->arr_id = $arr_id;
		$data->arr_kd = $arr_kd;
		$data->arr_ten = $arr_ten;
		
		
		$this->load->incView($data);
	}
}